public class text {
    public static void main(String[] args) {
        String s = "发爸撒妈的打发我去发撒WC打阿里巴巴发tx";
        String[] str = {"爸", "妈", "我去", "wc", "阿里巴巴","tx"};
        for (int i = 0; i <str.length ; i++) {
            if (s.contains(str[i])) {
                String replace = "*";
                for (int j = 0; j < str[i].length() - 1; j++) {
                    replace += "*";
                }
                s = s.replace(str[i], replace);
            }
        }
        System.out.println(s);
    }
}
